<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 绑定内联样式 -->
  <!-- 
    对象方法
      <div :style="objstyle"></div>
    
    数组方法
      <div :style="[basestyle,overstyle]"></div>
   -->
  <div id="app">
    <div :style="objstyle"></div>
    <input type="button" value="点击按钮改变大小" @click="handle">
    <div :style="[objstyle,overstyle]"></div>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        objstyle: {
          border: "1px solid red",
          width: "300px",
          height: "200px"
        },
        overstyle: {
          border: "5px solid green",
          width: "400px",
          height: "500px",
          background: "red"
        }
      },
      methods: {
        handle() {
          this.objstyle.height = "300px";
        }
      }
    });

  </script>
</body>

</html>
